package com.niuxiaofa.newlaw.Network;

import com.niuxiaofa.newlaw.Bean.BaseBean;
import com.niuxiaofa.newlaw.Bean.HeatBean;
import com.niuxiaofa.newlaw.Bean.NewOrderBean;

import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;

public class MallPresenter {

    /**
     *
     */
    public static void getAllVideoRedemption(interface_getAllVideoRedemption interface_getAllVideoRedemption) {
        Call<BaseBean> call = ServiceManager.getInstance().creat(ApiService.class).getAllVideoRedemption();
        call.enqueue(new Callback<BaseBean>() {
            @Override
            public void onResponse(Call<BaseBean> call, Response<BaseBean> response) {
                //判断请求是否成功
                if (response.isSuccessful()) {
                    BaseBean bean = (BaseBean) response.body();
                    interface_getAllVideoRedemption.getResponse(bean);
                }
            }

            @Override
            public void onFailure(Call<BaseBean> call, Throwable t) {
//            Log.e("链接错误", t.getMessage());

            }
        });

    }

    public interface interface_getAllVideoRedemption{
        void getResponse(BaseBean u);
    }




    public static void getHeat(interface_getHeat interface_getHeat) {
        Call<HeatBean> call = ServiceManager.getInstance().creat(ApiService.class).getHeat();
        call.enqueue(new Callback<HeatBean>() {
            @Override
            public void onResponse(Call<HeatBean> call, Response<HeatBean> response) {
                //判断请求是否成功
                if (response.isSuccessful()) {
                    HeatBean bean = (HeatBean) response.body();
                    interface_getHeat.getResponse(bean);
                }
            }

            @Override
            public void onFailure(Call<HeatBean> call, Throwable t) {
//            Log.e("链接错误", t.getMessage());

            }
        });

    }

    public interface interface_getHeat{
        void getResponse(HeatBean u);
    }
}
